package com.zhentao.controller;

import com.zhentao.file.service.FileStorageService;
import com.zhentao.model.common.dtos.ResponseResult;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.FileInputStream;

/*
 *云计算
 *魏子纹
 *2025/6/10
 */
@RequestMapping("/minio")
@RestController
public class MinioTestController {
    @Autowired
    private FileStorageService fileStorageService;
    @SneakyThrows
    @RequestMapping("/uploadHtml")
    public ResponseResult uploadHtml(){
        FileInputStream inputStream = new FileInputStream("E://IdeaCodeTest//zhuangao4//ProjectNews//zhentao-leadnews//testGIt//02.html");

        String url = fileStorageService.uploadHtmlFile("02-up.html", inputStream);
        return ResponseResult.okResult(url);
    }
}
